<?php

include_once 'conn.php';

function getFieldValue($table, $field, $wherefield="", $wherevalue="", $operator="=") {
    $sql = "select $field from $table";
    if ($wherefield != "") {
        $sql .= " where $wherefield $operator $wherevalue";
    }
    
    $res = mysql_query($sql);
    
    if (mysql_num_rows($res) > 0) {
        $row = mysql_fetch_row($res);
        return $row[0];
    }
    
    return "";
}

?>
